# _*_ coding: utf-8 _*_
"""
Time:     2024/8/28
Author:   2051261
File:     const.py
"""
from enum import Enum


class ContextKey:
    DIRTY = "dirty"
    DATA = "data"


class YmlDBConst:
    CONN_NAME = 'conn_name'
    MAX_OPEN_CONNECTIONS = "max_open_connections"
    MAX_IDLE_CONNECTIONS = "max_idle_connections"
    CONNECTION_MAX_LIFETIME = "connection_max_lifeTIME"
    DATABASE_TYPE = "database_type"
    DATABASE_NAME = "database_name"
    DATABASE_IP = "database_ip"
    DATABASE_PORT = "database_port"
    USER = "user"
    PASSWORD = "password"


class ENV:
    ONLINE = 'online'
    TEST = 'test'
    DEV = 'dev'

    ALL_ENVIRONMENTS = {ONLINE, TEST, DEV}  # 定义所有环境类型


class ConstKey:
    DIRTY = "dirty"
    TOTAL = "total"
    SKIP = "skip"
    INSERT = "insert"
    UPDATE = "update"
    DATA = "data"

    AFFECTED_ROWS = "affected_rows"
    LAST_ROW_ID = "last_row_id"

    MYSQL = "mysql"
    MSSQL = "mssql"

    UNIQUE_CONFLICT = "unique_key_conflict"


class Mark(Enum):
    INSERT_FAILED = -1
    UNIQUE_CONFLICT = 0
    VALUE_NOT_NONE = 1
    NOT_EMPTY_STR = 2
    NOT_INT = 3
    NOT_FLOAT = 4
    NOT_STR = 5
    NOT_IN_EXPECT_LIST = 6
